import 'package:alice_screen/util/i18n/localizations.dart';
import 'package:alice_screen/widgets/load_image.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class GuideInstall extends StatelessWidget {
  const GuideInstall({Key key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Center(
      child: Row(
        crossAxisAlignment: CrossAxisAlignment.center,
        children: <Widget>[
          SizedBox(width: ScreenUtil().setWidth(76.0),),
          phoneInstall(),
          SizedBox(width: ScreenUtil().setWidth(66.0),),
          Column(
            mainAxisAlignment: MainAxisAlignment.center,
            crossAxisAlignment: CrossAxisAlignment.start,
            children: <Widget>[
              Text(MyLocalizations.of(context).clickCorrespondingVersion,
                style: TextStyle(
                  color: Colors.white,
                  fontSize: ScreenUtil().setSp(28.0),
                  fontWeight: FontWeight.w500
                ),
              ),
              SizedBox(height: ScreenUtil().setHeight(18.0),),
              Text(MyLocalizations.of(context).installAndRegister,
                style: TextStyle(
                  color: Colors.white,
                  fontSize: ScreenUtil().setSp(44.0),
                  fontWeight: FontWeight.w500
                ),
              )
            ]
          )
        ],
      )
    );
  }

  Widget phoneInstall() {
    return Container(
      alignment: Alignment.center,
      width: ScreenUtil().setWidth(380.0),
      height: ScreenUtil().setHeight(284.0),
      child: Stack(
        alignment: Alignment.center,
        children: <Widget>[
          Positioned.fill(
            child: LoadAssetImage('guide/bg_phone',
              fit: BoxFit.fill,
            )
          ),
          Positioned(
            top: ScreenUtil().setHeight(42.0),
            child: LoadAssetImage('guide/phone_install',
              width: ScreenUtil().setWidth(272.0),
              height: ScreenUtil().setHeight(240.0),
              fit: BoxFit.fill,
            )
          ),
        ],
      )
    );
  }
}